home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group98b.txt / 000163_icon-group-sender _Fri Aug 28 13:12:14 1998.msg < prev    next >
Internet Message Format  |  2000-09-20  |  2KB

  1. Return-Path: <icon-group-sender>
  2. Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
  3.     by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) with SMTP id NAA02925
  4.     for <icon-group-addresses@baskerville.CS.Arizona.EDU>; Fri, 28 Aug 1998 13:12:14 -0700 (MST)
  5. Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
  6.     id AA19771; Fri, 28 Aug 1998 13:11:49 -0700
  7. To: icon-group@optima.CS.Arizona.EDU
  8. Date: 28 Aug 1998 13:58:54 -0400
  9. From: clayton@jazz.cc.gatech.edu (R. Clayton)
  10. Message-Id: <ml3iujdyom9.fsf@jazz.cc.gatech.edu>
  11. Organization: College of Computing, Georgia Tech
  12. Sender: icon-group-request@optima.CS.Arizona.EDU
  13. Subject: A prooner spogram.
  14. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  15. Status: RO
  16. Content-Length: 1313
  17.  
  18.   ja cat t.icn
  19.   procedure main()
  20.  
  21.     every p := perms(set(["g","m","h","f"])) do
  22.        write("A ", p[1], "ood ", p[2], "an is ", p[3], "ard to ", p[4], "ind.")
  23.  
  24.     end # main
  25.  
  26.  
  27.   procedure perms(letters)
  28.  
  29.     if *letters = 0 then
  30.       suspend ""
  31.     else
  32.       every l := !letters do
  33.     every suspend l || perms(delete(copy(letters), l))
  34.  
  35.     end # perms
  36.  
  37.   ja icont t.icn
  38.   Translating:
  39.   t.icn:
  40.     main
  41.     perms
  42.   No errors
  43.   Linking:
  44.  
  45.   ja ./t
  46.   A hood man is gard to find.
  47.   A hood man is fard to gind.
  48.   A hood gan is mard to find.
  49.   A hood gan is fard to mind.
  50.   A hood fan is mard to gind.
  51.   A hood fan is gard to mind.
  52.   A mood han is gard to find.
  53.   A mood han is fard to gind.
  54.   A mood gan is hard to find.
  55.   A mood gan is fard to hind.
  56.   A mood fan is hard to gind.
  57.   A mood fan is gard to hind.
  58.   A good han is mard to find.
  59.   A good han is fard to mind.
  60.   A good man is hard to find.
  61.   A good man is fard to hind.
  62.   A good fan is hard to mind.
  63.   A good fan is mard to hind.
  64.   A food han is mard to gind.
  65.   A food han is gard to mind.
  66.   A food man is hard to gind.
  67.   A food man is gard to hind.
  68.   A food gan is hard to mind.
  69.   A food gan is mard to hind.
  70.  
  71.   ja 
  72.  
  73. Why I wrote this program in five minutes instead of one minute:  I deleted l
  74. from letters itself instead of from a copy of letters.
  75.